This notebook compares the Flight Coach template spin entry to a recoreded one from a P23 sequence. Below the spin is extracted from a recorded P23 sequence.
from flightplotting.traces import axis_rate_trace
import plotly.graph_objects as go
from flightanalysis import Section, get_schedule
from flightplotting.plots import plotdtw, plotsec, compare_3d, aoa_brv_plot, control_brv_plot
import plotly
plotly.offline.init_notebook_mode()
flown_spin = Section.from_csv("examples/P23.csv").subset(241, 250)
Below a template spin is created, starting in the same position as the flown one.
from geometry import Quaternion, Transformation, Point
from flightanalysis import Section, State
from flightanalysis import Spin, Line
import numpy as np
transform = Transformation(
flown_spin[flown_spin.data.index.get_loc(2.2, method="nearest")].pos,
Quaternion.from_euler((0.0, 0.0, np.pi))
)
line_before = Line(15).create_template(transform, 30.0)
spin = Spin(2.5).scale(170).create_template(line_before[-1].transform, 30.0)
downline = Line(10).create_template(spin[-1].transform, 30.0)
spin = Section.stack([line_before, spin, downline])
fig = plotsec(spin, scale=3, nmodels=5, color="blue")
fig2 = plotsec(flown_spin, scale=3, nmodels=5)
fig.add_traces(fig2.data)
fig.show()
aoa_brv_plot(flown_spin).update_layout(width=800,height=300).show()
aoa_brv_plot(spin).update_layout(width=800,height=300).show()
import numpy as np
import pandas as pd
#aileron = pd.mean(sec.data[:, ["aileron_1", "aileron_2"]])
control_brv_plot(flown_spin).update_layout(width=1200,height=400).show()